package com.youxuan.controller;

import com.youxuan.pojo.entity.Category;
import com.youxuan.pojo.entity.ResponseResult;
import com.youxuan.service.CategoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
@Api(tags = "分类")
public class CategoryController {

    @Autowired
    private CategoryService categoryService;

    @ApiOperation("分类列表")
    @GetMapping("/list")
    public ResponseResult<List<Category>> getList(){
        return categoryService.getList();
    }

}
